import Vue from 'vue'
import VueRouter from "vue-router";
import Layout from "../views/Layout"
import Article from "../views/Article"
import Collect from "../views/Collect"
import Like from "../views/Like"
import User from "../views/User"
import ArticleDetail from "../views/ArticleDetail"
Vue.use(VueRouter)


const router = new VueRouter({
  routes: [
    {
      // 重定向这样一开始就在内容页面
      path:'/',redirect:'/article',
      component:Layout,
      children:[
        {
          path:'/article',
          component:Article
        },
        {
          path:'/Collect',
          component:Collect
        },
        {
          path:'/Like',
          component:Like
        },
        {
          path:'/User',
          component:User
        },
    ]
    },
    {
      path:'/ArticleDetail/:id',
      component:ArticleDetail,
    }
  ]
})

export default router